<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
  	<meta charset="utf-8">
    <base href="<%=basePath%>">
    <title>用户注册</title>
    <script type="text/javascript" src="js/jquery-1.11.3.js"></script>
    <script type="text/javascript">
    	function addUsers(){
    		$.post("json/Users_addUsers",$("#myform").serialize(),function(data){
    			if(parseInt(data.result)!=0){
    				location.href="login.jsp";
    			}else{
    				alert("注册失败....");
    			}
    		},"json" );
    	}
    
    </script>
  </head>
  
  <body>
    	<form action="" method="post" id="myform">
    		角色：<select name="users.role">
    				<option value="1">普通用户</option>
    				<option value="2">管理员</option>
    			</select>
    		用户名：<input type="text" name="users.uname" />
    		密码：<input type="password" name="users.pwd" />
    		<input type="button" value="注册" onclick="addUsers()">
    	</form>
  </body>
</html>
